﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;

public partial class service_more : System.Web.UI.Page
{
    public string szjqL = "";     //实战技巧左
    public string szjqR = "";    //实战技巧中
    public string szjqR1 = "";    //实战技巧右

    protected void Page_Load(object sender, EventArgs e)
    {
        szjqL = SzjqL().ToString();
        szjqR = SzjqR().ToString();
        szjqR1 = SzjqR1().ToString();
    }

    private Web_VedioBLL videoBll;
    /// <summary>
    /// 视频业务类
    /// </summary>
    private Web_VedioBLL VideoBll
    {
        get
        {
            if (videoBll == null)
            {
                videoBll = new Web_VedioBLL();
            }
            return videoBll;
        }
    }

    /// <summary>
    /// 实战技巧左
    /// </summary>
    protected StringBuilder SzjqL()
    {

        DataTable dt = VideoBll.Szjq;
        StringBuilder sbSzjq = new StringBuilder();
        if (dt == null)
        {
            sbSzjq.AppendLine("<li>服务器忙，请重试</a>");
        }
        else
        {
            for (int i = 0; i < dt.Rows.Count / 3; i++)
            {
                System.Data.DataRow sRow = dt.Rows[i];
                string sId = Convert.ToString(sRow["v_id"]);
                string sTitle = Convert.ToString(sRow["v_title"]);
                sbSzjq.Append("<li><a href='" + "videoroom.aspx?id=" + sId + "' target=\"_blank\">" + (sTitle.Length > 20 ? sTitle.Substring(0, 20) + "..." : sTitle) + "</a></li>\r\n");
            }
        }
        return sbSzjq;
    }

    /// <summary>
    /// 实战技巧中
    /// </summary>
    protected StringBuilder SzjqR()
    {

        DataTable dt = VideoBll.Szjq;
        StringBuilder sbSzjq = new StringBuilder();
        if (dt != null)
        {
            for (int i = dt.Rows.Count / 3; i < dt.Rows.Count/3*2; i++)
            {
                System.Data.DataRow sRow = dt.Rows[i];
                string sId = Convert.ToString(sRow["v_id"]);
                string sTitle = Convert.ToString(sRow["v_title"]);
                sbSzjq.Append("<li><a href='" + "videoroom.aspx?id=" + sId + "' target=\"_blank\">" + (sTitle.Length > 21 ? sTitle.Substring(0, 21) + "..." : sTitle) + "</a></li>\r\n");
            }
        }
        else
        {
            sbSzjq.AppendLine("<li>服务器忙，请重试</li>");
        }
        return sbSzjq;
    }
    /// <summary>
    /// 实战技巧右
    /// </summary>
    protected StringBuilder SzjqR1()
    {

        DataTable dt = VideoBll.Szjq;
        StringBuilder sbSzjq1 = new StringBuilder();
        if (dt != null)
        {
            for (int i = dt.Rows.Count / 3 * 2; i < dt.Rows.Count; i++)
            {
                System.Data.DataRow sRow = dt.Rows[i];
                string sId = Convert.ToString(sRow["v_id"]);
                string sTitle = Convert.ToString(sRow["v_title"]);
                sbSzjq1.Append("<li><a href='" + "videoroom.aspx?id=" + sId + "' target=\"_blank\">" + (sTitle.Length > 21 ? sTitle.Substring(0, 21) + "..." : sTitle) + "</a></li>\r\n");
            }
        }
        else
        {
            sbSzjq1.AppendLine("<li>服务器忙，请重试</li>");
        }
        return sbSzjq1;
    }
}